package cn.edu.hust.sse.software7.class3.common;

import java.math.BigInteger;
import java.security.MessageDigest;

public class MD5Tool {
	public static String Encrypt(String srcStr) {
		MessageDigest md;
		try {
			md = MessageDigest.getInstance("MD5");
			md.update(srcStr.getBytes());
			String pwd = new BigInteger(1, md.digest()).toString(16);
		    System.err.println(pwd);
		    return pwd;
		} catch (Exception e) {
			// TODO: handle exception
		}
		return srcStr;
	}
}
